<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
		<title>jConference {version}</title>
		{include static_files}
		<script type="text/javascript">
		$(document).ready(function(){
				if(!($.browser.webkit||$.browser.safari||$.browser.mozilla)){
					$d = $.dia({pos:"center",mod:true,close:function(){
						window.location.replace('http://www.google.com/chrome');
					}});
					$d.html('К сожелению ваш <a href="http://ru.wikipedia.org/wiki/%D0%91%D1%80%D0%B0%D1%83%D0%B7%D0%B5%D1%80" class="b">браузер</a> не поддерживается.<p>jConference поддерживает следующии <a href="http://ru.wikipedia.org/wiki/%D0%91%D1%80%D0%B0%D1%83%D0%B7%D0%B5%D1%80" class="b">веб-обозреватели</a>:</p><ul><li><a href="http://www.google.com/chrome" class="off_a">Google Chrome</a></li><li><a href="http://mozilla-russia.org/" class="off_a">Mozilla Firefox 5</a></li><li><a href="http://www.apple.com/ru/safari/download/" class="off_a">Safari 5</a></li></ul>')
					$d.dialog('open');
				}
		});
			function initMain(notFirstInit) {
				var o = $('#time_to_end'),end_date=new Date(o.data('end'));
				function showTimer() {
					if(end_date=="")
						return false;
					var now = new Date();

					function getDaysLeft(now) {
						return end_date > now ? Math.ceil((end_date - now) / (1000 * 60 * 60 * 24)) : null;
					}

					var sTime = end_date + " 00:00:00";
					var oDeadLineDate = new Date(sTime);
					var nDaysLeft = getDaysLeft(now);
					if (nDaysLeft) {
						var sDaysLeft = String(nDaysLeft);
						var sDaysText = "дней";
						var nDaysLeftLength = sDaysLeft.length;
						if (sDaysLeft.charAt(nDaysLeftLength - 2) != "1") {
							if (sDaysLeft.charAt(nDaysLeftLength - 1) == "2" || sDaysLeft.charAt(nDaysLeftLength - 1) == "3" || sDaysLeft.charAt(nDaysLeftLength - 1) == "4")
								sDaysText = "дня";
							else if (sDaysLeft.charAt(nDaysLeftLength - 1) == "1")
								sDaysText = "день";
						}
						var sLeftText = sDaysText == "день" ? "остался" : "осталось";
						o.text(nDaysLeft + " " + sDaysText + ".");
						$('#sp_day',o.parent()).text(" "+sLeftText+" - ");
						setTimeout(showTimer,600000);
					}
				}

				showTimer();

				//****************************  Анимация шапки  **********************************
				var mainDIV = $('#mainDIV');
				var hp0 = $("#head_part_0"),hp1 = $("#head_part_1"),hp2 = $("#head_part_2"),hp3 = $("#head_part_3");
				var logo_size = [47,62];
				mainDIV.show('fade',1200, function() {
					if(!notFirstInit) {
						hp0.show('slide', {
							direction:'up'
						},800, function() {
							hp0.animate({
								width:logo_size[0]-8,
								height:logo_size[1]-8,
								opacity:0.8,
								marginLeft:4,
								marginTop:4
							});
						});
						hp1.show('slide', {
							direction:'left'
						},500, function() {
							hp2.show('slide', {
								direction:'right'
							},500, function() {
								hp3.show('slide', {
									direction:'left'
								},500, function() {
									$('#time_to_end').parent().show('slide', {
										direction:"right"
									},500);
								});
							});
						});
					}
				});
				//********************************************************************************

				//********************  Выравнивание ширины кнопок меню  ************************
				window.alignButtonWidth = function() {
					var maxW=0;
					$('.menu .but').button().each( function() {
						var o=$(this);
						var w = o.width();
						if(maxW<w)
							maxW=w;
					}).width(maxW+20);
				}
				window.alignButtonWidth();
				//********************************************************************************

				//****************************  Основные табы  ***********************************
				$('#tabs-content').tabs({
					fx: {
						opacity: 'toggle'
					},
					add: function( event, ui ) {
						var html = $(this).data('html');
						$(ui.panel).append(html);
					},
					cookie: {
						expires: 30
					}
				}).removeClass('ui-corner-all');
				//********************************************************************************

				//**********************  Авторизация по нажатию на Enter  ***********************
				$.onEnter('#login_button','#logInForm');
				//********************************************************************************

				//************************  Древовидный показ снкций  ****************************
				/*$('#sections_tree').treeview({
				collapsed:true,
				animated:'medium'
				});*/
				//********************************************************************************

				window.selectTheme = function(url,flag) {
					if(flag)
						url = url.replace(/\\/g,'');
					var t = $('#' + $.themes._linkID);
					if(t.length==0)
						t=$('<link id="'+$.themes._linkID+'" rel="stylesheet" type="text/css" media="printer" charset="utf-8">').appendTo('head');
					$("body").hide('fade',800, function() {
						t.attr('href', url);
						t.attr('media','screen');
						$('link.ui-common-css').appendTo('head').attr('src','static/css/common.css?r'+Math.random()*10000);
						$(this).show('fade',800);
						var theme = url.replace(/static\/css\/ui-theme\/([\w-]+)\/jquery-ui-1\.8\.6\.custom\.css$/g,'$1');
						if(flag)
							return true;
						$.post('user/setTheme', {
							theme:theme
						});
					});
				}
				$.themes.init({
					onSelect: function(id, display, url) {
						//$.themes._themes[jQuery.cookie('themeID')].url
						window.selectTheme(url);
					}
				});

				jQuery.ajaxSetup({
					data: {
						ajax:true,
						json:true
					},
					async: true,
					timeout:10000,
					error: function() {
						$.jLoading('stop');
					}
				});
			};
		</script>
	</head>
	<body>
		
<!-- 		<div id="warning" title="Внимание!!!" >
			<p>Для работы с системой конференций, необходимо использовать </p>
		</div> -->
		
		<div id='mainDIV' style="width:1000px;" class='center hide_'>
			{include blocks/header}
			<div style='border-right:1px solid silver;border-left:1px solid silver'>
				<table style="width:100%;" cellspacing="0">
					<tr>
						<td id="tabs-content" style="width:80%;border-right: 1px solid #AAA!important; border: none;" class="top p5">
						<ul class='mainTabs'>
							{tabs_buttons}
						</ul>
						{tabs}
						</td>
						<td style="width:20%;" class='p5 top ct'>
						<div class="p5 top ct">
							{include blocks/nav}
						</div>
						</td>
					</tr>
				</table>
			</div>
			{include blocks/footer}
		</div>
		<div id="displayOverlay">
		</div>
	</body>
</html>